Skip to content

Add mention of sendfile(2) and splice(2) to fs::copy() documentation.#155970

Open
tomilepp wants to merge 1 commit intorust-lang:mainfrom
tomilepp:issue-155968-fix
Open

Add mention of sendfile(2) and splice(2) to fs::copy() documentation.#155970
tomilepp wants to merge 1 commit intorust-lang:mainfrom
tomilepp:issue-155968-fix

Conversation

@tomilepp
Copy link
Copy Markdown

@tomilepp tomilepp commented Apr 29, 2026

Fixes #155968 by adding mention of sendfile(2) and splice(2) from io::copy()

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 29, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 29, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt, nia-e

@LFS6502 LFS6502 added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Apr 30, 2026
Comment thread library/std/src/fs.rs
/// On Linux (including Android), this function attempts to use `copy_file_range(2)`,
/// and falls back to reading and writing if that is not possible.
/// On Linux (including Android), this function uses copy_file_range(2),
/// sendfile(2) or splice(2) syscalls to move data directly between files
Copy link
Copy Markdown
Member

@joshtriplett joshtriplett May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// sendfile(2) or splice(2) syscalls to move data directly between files
/// sendfile(2), or splice(2) syscalls to move data directly between files

(Oxford comma.)

View changes since the review

@joshtriplett
Copy link
Copy Markdown
Member

LGTM. r=me with the nit fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

std::fs::copy() documentation doesn't mention sendfile(2) or splice(2)

5 participants